#include "levelselectwidget.h"
#include "ui_levelselectwidget.h"

LevelSelectWidget::LevelSelectWidget(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::LevelSelectWidget),
    m_nIndexSelect(-1)
{
    ui->setupUi(this);
    this->setWindowFlags(Qt::WindowStaysOnTopHint | Qt::Tool | Qt::FramelessWindowHint);

    QButtonGroup *btnGroup = new QButtonGroup(this);
    btnGroup->addButton(ui->btnLevel3, 0);
    btnGroup->addButton(ui->btnLevel4, 1);
    btnGroup->addButton(ui->btnLevel5, 2);
    btnGroup->addButton(ui->btnLevel6, 3);
    btnGroup->addButton(ui->btnRanking, 4);

    connect(btnGroup, SIGNAL(buttonClicked(int)), this, SLOT(SltButtonClicked(int)));
}

LevelSelectWidget::~LevelSelectWidget()
{
    delete ui;
}

void LevelSelectWidget::SltButtonClicked(int index)
{
    m_nIndexSelect = index;
    this->reject();
}
